package cn.iocoder.yudao.module.erp.dal.mysql.costinfo;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.erp.dal.dataobject.costinfo.CostInfoDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.erp.controller.admin.costinfo.vo.*;

/**
 * 其他费用 Mapper
 *
 * @author 王1
 */
@Mapper
public interface CostInfoMapper extends BaseMapperX<CostInfoDO> {

    default PageResult<CostInfoDO> selectPage(CostInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CostInfoDO>()
                .eqIfPresent(CostInfoDO::getType, reqVO.getType())
                .eqIfPresent(CostInfoDO::getCustomerId, reqVO.getCustomerId())
                .eqIfPresent(CostInfoDO::getAmountType, reqVO.getAmountType())
                .eqIfPresent(CostInfoDO::getAccountId, reqVO.getAccountId())
                .betweenIfPresent(CostInfoDO::getAmount, reqVO.getAmount())
                .betweenIfPresent(CostInfoDO::getGetTime, reqVO.getGetTime())
                .likeIfPresent(CostInfoDO::getRemark, reqVO.getRemark())
                .eqIfPresent(CostInfoDO::getFileUrl, reqVO.getFileUrl())
                .betweenIfPresent(CostInfoDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CostInfoDO::getId));
    }

}